package com.andy.nature.ui.fragment

import com.andy.common.base.BaseVMFragment
import com.andy.common.extend.setOnIMClickListener
import com.andy.nature.databinding.FragmentToolBinding
import com.andy.nature.vm.ToolViewModel

/**
 * Author:Andy
 * Date:2023/3/21 14:17
 * Description:StrangerFragment
 */
class ToolFragment : BaseVMFragment<FragmentToolBinding, ToolViewModel>() {
    override fun viewModelClass(): Class<ToolViewModel> {
        return ToolViewModel::class.java
    }

    override fun initObserve() {
    }

    override fun initData() {
    }

    override fun initAction() {
        mBinding?.apply {
            tvJson2Model.setOnIMClickListener {
                mViewModel.convertJson2Model()
            }
            tvModel2Json.setOnIMClickListener {
                mViewModel.convertModel2Json()
            }
            tvJson2Map.setOnIMClickListener {
                mViewModel.convertJson2Map()
            }
            tvMap2Json.setOnIMClickListener {
                mViewModel.convertMap2Json()
            }
        }
    }

    override fun getViewBinding(): FragmentToolBinding {
        return FragmentToolBinding.inflate(layoutInflater)
    }
}